package com.yxw.service.impl;

import com.yxw.mapper.UserMapper;
import com.yxw.pojo.User;
import com.yxw.service.UserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service("userService")
public class UserServiceImpl implements UserService {
    @Resource
    private UserMapper userMapper;

    public User getUserByUserCode(User user) {
        User user1 = userMapper.getUserByUserCode(user.getUserCode());

        if (user1 == null) {
            return null;
        }

        if (user1.getUserPassword().equals(user.getUserPassword())) {
            return user1;
        }
        return null;
    }
}
